import { Controller, Get, Post, Body, Patch, Param, Delete } from "@nestjs/common";
import { UserRoleService } from "./user-role.service";
import { CreateUserRoleDto } from "./dto/create-user-role.dto";
import { UpdateUserRoleDto } from "./dto/update-user-role.dto";
import { userAddRoleDto } from "./dto/user-add-role-dto";

@Controller("userRole")
export class UserRoleController {
	constructor(private readonly userRoleService: UserRoleService) {
	}
	
	@Post()
	create(@Body() createUserRoleDto: CreateUserRoleDto) {
		return this.userRoleService.create(createUserRoleDto);
	}
	
	@Get()
	findAll() {
		return this.userRoleService.findAll();
	}
	
	@Get(":id")
	findOne(@Param("id") id: string) {
		return this.userRoleService.findOne(+id);
	}
	
	@Patch(":id")
	update(@Param("id") id: string, @Body() updateUserRoleDto: UpdateUserRoleDto) {
		return this.userRoleService.update(+id, updateUserRoleDto);
	}
	
	@Delete(":id")
	remove(@Param("id") id: string) {
		return this.userRoleService.remove(+id);
	}
	
	@Post("userAddRole")
	userAddRole(@Body() userAddRoleDto: userAddRoleDto) {
		return this.userRoleService.userAddRole(userAddRoleDto);
	}
}
